# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>

pkgname=rust-bindgen
pkgver=0.66.1
pkgrel=0
pkgdesc="automatically generates Rust FFI bindings to C (and some C++) libraries"
url="https://github.com/rust-lang/rust-bindgen"
makedepends="cargo clang cargo-auditable"
arch="all"
license="BSD-3-Clause"
options="net !check" # no test
source="$pkgname-$pkgver.tar.gz::https://github.com/rust-lang/rust-bindgen/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

package() {
	install -Dm755 target/release/bindgen "$pkgdir"/usr/bin/bindgen
}

sha512sums="
71e1ec6ce4933a7a5451aa5baa47f885b9ec6b692bf2a2b3d8c1f2cce2c3cd3d941f8b8e4dfd7c776e954a9d3824b67c435897521f726553b63a2f1cb81bba99  rust-bindgen-0.66.1.tar.gz
"
